<?php

use Illuminate\Database\Seeder;

class UsersTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $time = date('Y-m-d H-i:s');
        for($i = 0; $i <100 ; $i ++)
        {
            $data = [
                'name' => str_random(10),
                'email' => str_random(10).'@gmail.com',
                'password' => Crypt::encryptString('123'),
                'phone' =>'17660388896',
                'token' => str_random(50),
                'airline' => 0,
                'created_at' => $time,
                'updated_at' => $time,

            ];
            $userId = DB::table('users') -> insertGetId($data);
            $pic = '/uploads/avatar/default.jpg';
            DB::table('users_info') -> insert(['user_id' => $userId,
                'pic' => $pic,
                'created_at' => $time,
                'updated_at' => $time,
                ]);
        }

    }
}
